
// #ifndef VUE3
import Vue from 'vue'
import App from './App'

Vue.config.productionTip = false
App.mpType = 'app'

const app = new Vue({
    ...App
})


app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
import uviewPlus from 'uview-plus'
import App from './App.vue'
import Cache from '@/utils/cache';
export function createApp() {
  const app = createSSRApp(App)
	app.config.globalProperties.setPageTitle = function(pageTitle){
		let title = JSON.parse( Cache.get("config"));
		uni.setNavigationBarTitle({
		        title: title.sitename + '-'+pageTitle
		        
		      });
	}
	app.config.globalProperties.getConfig = function(key){
		let config = JSON.parse( Cache.get("config"));
		return config[key];
	}
	app.config.globalProperties.toast =  function (text){
 			uni.showToast({
 				title:text,
 				icon : 'none',
				duration:3000
 			});
		}
	app.config.globalProperties.goto = function(page){
		uni.navigateTo({
			url:'/pages/'+ page
		})
	},
    app.use(uviewPlus)

    return {
      app
    }
}

// #endif